// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  ssr: false,
  app: {
    baseURL: `/${process.env.NUXT_APP_PATH}/`, //在生产中服务时的基本公共路径
    head: {
      link: [{ rel: "icon", type: "image/x-icon", href: "favicon.ico" }],
      title: "流程管理系统",
    },
  },
  devtools: {
    enabled: false,

    timeline: {
      enabled: true,
    },
  },
  modules: [
    "@element-plus/nuxt",
    "@vueuse/nuxt",
    "@nuxt/test-utils/module",
    "@pinia/nuxt",
    "@pinia-plugin-persistedstate/nuxt",
  ],
  css: [
    "normalize.css",
    "element-plus/dist/index.css",
    "vform3-builds/dist/designer.style.css",
  ],
  imports: {
    dirs: [
      // Scan top-level modules
      "composables",
      // 服务端接口封装
      "services",
    ],
  },
  runtimeConfig: {
    public: {
      serverUrl: process.env.NUXT_SERVER_URL,
      loginUrl: process.env.NUXT_LOGIN_URL,
      appPath: process.env.NUXT_APP_PATH,
    },
  },
  routeRules: {
    "/": { redirect: "/home" },
  },
  piniaPersistedstate: {
    storage: "localStorage", // pinia持久化位置
  },
  nitro: {
    output: {
      publicDir: process.env.NUXT_APP_PATH,
    },
  },
  vite: {
    build: {
      assetsInlineLimit: 0,
    },
  },
});
